package com.wys.ws_im.controller;

import com.wys.ws_im.map.OnlineMap;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author wys
 * created in 0:42 2019/5/4
 */
@Controller
public class HelloController {


    private Map<String, String> stringSessionMap = new ConcurrentHashMap<>();
    private int c = 0;

    @GetMapping("/index")
    public String index(){
        return "index";
    }

    @GetMapping("/home")
    public String home(){
        return "html/home";
    }

    @GetMapping("/account")
    public void accot(String account) {
        stringSessionMap.put(account, account);
        for (String key : stringSessionMap.keySet()) {
            System.out.println("key = " + key);
        }
    }

    @GetMapping("/count")
    public void count() {
        c++;
        System.out.println("c = " + c);
    }


    @GetMapping("/read")
    public void read() {
        System.out.println("ontest" );
        for (String key : OnlineMap.onlineUserMap.keySet()) {
            System.out.println("key = " + key);
        }
    }



}